package xin.ganbo.utils;

import xin.ganbo.entity.User;

import javax.servlet.http.HttpSession;

/**
 * 系统应用工具方法
 * @author ganbo E-mail:bo.gan@56qq.com
 * @since 2017-12-04 11:34
 */

public class AppUtil {

    /**
     * 获取当前登陆用户
     * @param session
     * @return
     */
    public static User getSessionUserInformation(HttpSession session) {
        User user = null;
        if (session != null) {
            Object attribute = session.getAttribute(ConstantConfig.USER_IN_SESSION);
            if (attribute != null) { user = (User) attribute; }
        }
        return user;
    }
}
